package com.sure.supermarketserver.stock.maintenance.dao;

import com.sure.supermarketserver.stock.maintenance.Maintenance;
import com.sure.supermarketserver.stock.maintenance.MaintenanceDto;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface MaintenanceDao {
    List<Maintenance> findMaintenanceList(MaintenanceDto dto);

    @Insert("insert into cargo(ca_id,st_id,ty_id,ca_name,ca_unit,ca_date,ca_price) values(#{ca_id},#{st_id},#{ty_id},#{ca_name},#{ca_unit},#{ca_date},#{ca_price})")
    void insertMaintenance(MaintenanceDto dto);

    @Delete("delete from cargo where ca_id=#{id}")
    void deleteMaintenance(String id);

    @Update("update cargo set st_id=#{st_id},ty_id=#{ty_id},ca_name=#{ca_name},ca_unit=#{ca_unit},ca_date=#{ca_date},ca_price=#{ca_price} where ca_id=#{ca_id}")
    void updateMaintenance(MaintenanceDto dto);


}
